var PromiseMethodUtil = {
  queuePromise: function (promiseList) {
    var sequence = Promise.resolve();
    var data = [];
    var index = 0;
    var promiseDataMethod = function (sequence) {
      var obj = promiseList[index];
      if (obj === undefined) {
        return sequence;
      }
      index++;
      sequence = sequence.then(function () {
        var methodFun, params = [];
        if (_.isFunction(obj)) {
          methodFun = obj;
        } else {
          methodFun = obj.method;
          params = obj.params;
        }
        return methodFun.apply(this, params);
      }).then(function (res) {
        data.push(res);
        return data;
      });
      return promiseDataMethod(sequence);
    }
    return promiseDataMethod(sequence);
  }
};